<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>上传发票图片</title>
<script type="text/javascript" src="script/jquery-3.2.1.min.js"></script>
<script type="text/javascript">

		var ip2; //host_ip
        //读取config.xml配置ip等信息
        function loadxml(fileName) {
        	$.ajax({
        		async : false,
        		url : fileName,
        		dataType : "xml",
        		type : "GET",
        		success : function(res, status) {
        			var xml_data = res;
        			ip2 = xml_data.getElementsByTagName("connect_ip")[0].innerHTML;
					alert(ip2);
        		},
        		error : function() {
        			alert("读取配置文件失败，稍后重试");
        		}
        	})
        }
		
function addModel(){
    $.ajax({
        type: "POST",
		dataType: "json",
        url: "http://localhost:8080/invoice/addModel",
        data: {"img_str":"imag_str", "user_id":1,"json_model":"json_model"},
        success: function(msg){
            alert(msg);
        }
    })
}	

function changeModelUrl(){
    $.ajax({
        type: "POST",
		dataType: "json",
        url: "http://localhost:8080/invoice/changeImageUrlIp",
        data: {},
        success: function(msg){
            alert(msg);
        }
    })
}


function rewriteJsonModel(){
    $.ajax({
        type: "POST",
		dataType: "json",
        url: "http://localhost:8080/invoice/rewriteJsonModel",
        data: {},
        success: function(msg){
            alert(msg);
        }
    })
}

	$(document).ready(function() {
	loadxml("config.xml");
	$("form").each(function(){$(this).get(0).action = "http://"+ip2+"/invoice/recognizeImage.action"});
	})
</script>
</head>
<body>

<h1>用户上传图片（多图）：</h1>
<form  method="post" enctype="multipart/form-data" >
图片1：<input type="file" name="file1" />
图片2：<input type="file" name="file2" />
图片3：<input type="file" name="file3" />
<br>
<br>
图片4：<input type="file" name="file4" />
图片5：<input type="file" name="file5" />
图片6：<input type="file" name="file6" />
<br>
<br>
图片7：<input type="file" name="file7" />
图片8：<input type="file" name="file8" />
图片9：<input type="file" name="file9" />
图片10：<input type="file" name="file10"/>
<br>
<br>
user_id：<input type="text" name="user_id" value="1"/>
  <input type="submit" value="提交" > 
</form>


<br>
<br>
用户上传图片（单图）：
<form method="post" enctype="multipart/form-data">
图片1：<input type="file" name="file1" />
user_id：<input type="text" name="user_id" value="1"/>
  <input type="submit" value="提交" > 
</form>


</body>
</html>